package com.kaiyidiannao.activity.foodpalace;

import android.app.Activity;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.RatingBar;
import android.widget.TextView;
import com.baidu.location.BDLocation;
import com.kaiyidiannao.common.BaseActionBarActivity;
import com.kaiyidiannao.main.R;
import com.kaiyidiannao.view.ActionBarView;

/**
 * Created by mark on 2014/4/10.
 */
public class StarComment extends BaseActionBarActivity {

    private RatingBar rating;
    private TextView ratingScore;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.foodpalace_starcomment);

        ratingScore = (TextView)findViewById(R.id.ratingScore);
        rating = (RatingBar)findViewById(R.id.rating);
        rating.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
            @Override
            public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
                ratingScore.setText(rating+"分");
            }
        });

        findActionBar();
    }

    private void findActionBar() {
        actionBarView = (ActionBarView) findViewById(R.id.actionbar);
        actionBarView.setTitle("星评");
        actionBarView.button_right_icon1.setVisibility(View.VISIBLE);
        actionBarView.button_right_icon1.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.positive_button));

        actionBarView.button_right_icon1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });

    }
}
